<?php

class log {

    static $CurrLogLevel = 'NOTICE';

    static public function warning($msg, $w = false, $p = true) {
        $msg = 'WARNING:' . $msg;
        self::$CurrLogLevel = 'WARNING';
        return logformat($msg, $w, $p);
    }

    static public function notice($msg, $w = false, $p = true) {
        $msg = 'NOTICE:' . $msg;
        self::$CurrLogLevel = 'NOTICE';
        return logformat($msg, $w, $p);
    }

    static public function error($msg, $w = false, $p = true) {
        $msg = 'ERROR:' . $msg;
        self::$CurrLogLevel = 'ERROR';
        if (defined('ERROR_EXIT') && !ERROR_EXIT) {
            return logformat($msg, $w, $p);
        } else {
            return die(logformat($msg, $w, $p));
        }
    }

    static public function w($msg, $w = false, $p = true) {
        return self::warning($msg, $w, $p);
    }

    static public function warn($msg, $w = false, $p = true) {
        return self::warning($msg, $w, $p);
    }

    static public function n($msg, $w = false, $p = true) {
        return self::notice($msg, $w, $p);
    }

    static public function e($msg, $w = false, $p = true) {
        return self::error($msg, $w, $p);
    }

    static public function dw($msg, $w = false, $p = true) {
        self::warning('====================ATTENTION===================', $w, $p);
        self::warning($msg, $w, $p);
        return self::warning('====================ATTENTION===================', $w, $p);
    }

}

?>